﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;


namespace PrinterBudi.Persistence
{
    public class PBTransaction
    {
        public virtual int Id { set; get; }
        public virtual DateTime UploadDate { set; get; }
        public virtual string FileName { set; get; }
        public virtual string Status { set; get; }
        public virtual string Destination { set; get; }
        public virtual string Description { set; get; }
        public virtual int TotalPrice { set; get; }
        public virtual string PaperType { set; get; }
        public virtual string PaperSize { set; get; }
        public virtual int NumCopy { set; get; }
        public virtual DateTime DeliveredDate { set; get; }
        public virtual PBUser PBUser { set; get; }
        public virtual PBEmployee PBEmployee { set; get; }
    }

    public class PBTransactionMap : ClassMap<PBTransaction>
    {
        public PBTransactionMap()
        {
            Id(x => x.Id, "Id").GeneratedBy.Increment();
            Map(x => x.UploadDate, "UploadDate");
            Map(x => x.FileName, "FileName");
            Map(x => x.Status, "Status");
            Map(x => x.Destination, "Destination");
            Map(x => x.Description, "Description");
            Map(x => x.TotalPrice, "TotalPrice");
            Map(x => x.PaperType, "PaperType");
            Map(x => x.PaperSize, "PaperSize");
            Map(x => x.NumCopy, "NumCopy");
            Map(x => x.DeliveredDate, "DeliveredDate");
            References<PBUser>(x => x.PBUser).Column("PBUserId").Cascade.All();
            References<PBEmployee>(x => x.PBEmployee).Column("PBEmployeeId").Cascade.All();
            Table("PBTransaction");
        }
    }
}
